package com.kmwiki.Utility;

public class myStr {

	public  String CheckNull(String s) {
		if (s == null)	return "";
		return s;
	}
	public  String CheckNull(String s, String strdefault) {
		if (s == null)	return strdefault;
		if (s == "")	return strdefault;
		return s;
	}
	
 	public  String GuidString() {
		String result = "";
    	java.util.UUID uuid = java.util.UUID.randomUUID();
    	result = uuid.toString();
		return result;
	}
 	
 	public  String FirstCharToUpper(String mValue) {
		String result = "";
		result = mValue.substring(0,1).toUpperCase() + mValue.substring(1,mValue.length()); 
		return result;
	}
 	public  String intToStr(int mValue) {
		String result = String.valueOf(mValue);
		return result;
	} 	
 	
 	  public  String removeHTML(String htmlString)
 	  {
 	        // Remove HTML tag from java String    
 	      String noHTMLString = htmlString.replaceAll("\\<.*?\\>", "");

 	      // Remove Carriage return from java String
 	      noHTMLString = noHTMLString.replaceAll("\r", "<br/>");

 	      // Remove New line from java string and replace html break
 	      noHTMLString = noHTMLString.replaceAll("\n", " ");
 	      noHTMLString = noHTMLString.replaceAll("\'", "&#39;");
 	      noHTMLString = noHTMLString.replaceAll("\"", "&quot;");
 	      return noHTMLString;
 	  }  
 	  public  String StrtoMaxLength(String content, int max)
 	  {
 	      if (content.length() < max) max = content.length();
 	      return content.substring(0,max);
 	  }    
 	
}

/*
 	public static String funtionname()
	{
		String result = "";
		
		return result;
	}
*/
